import { getAction, postAction } from '@/api/manage'

// 定时任务列表
const list = (params) => getAction('/admin/scheduledTask/page', params)
// 删除定时任务
const del = (params) => postAction(`/admin/scheduledTask/delete/${params}`)
// 批量删除定时任务
const batchDel = (params) => postAction(`/admin/scheduledTask/batchDel`, params)
// 新增定时任务
const create = (params) => postAction('/admin/scheduledTask/create', params)
// 编辑定时任务
const edit = (params) => postAction('/admin/scheduledTask/update', params)
// 立即执行定时任务
const startNow = (params) => postAction('/admin/scheduledTask/startNow', params)
// 暂停/恢复定时任务
const change = (params) => postAction('/admin/scheduledTask/change', params)

export {
  list,
  del,
  batchDel,
  create,
  edit,
  startNow,
  change
}
